require("@babel/polyfill");
import * as React from "react";
import * as ReactDOM from "react-dom";
import routes from '@/router/index'
import { renderRoutes } from 'react-router-config'
import { HashRouter } from 'react-router-dom'

const { Suspense } = React;

const Spin = () => <>Loading...</>

if (module && module.hot) module.hot.accept()

window.addEventListener('touchmove', function () { }, { passive: false });

ReactDOM.render(
    <HashRouter>
      <Suspense fallback={<Spin />}>{renderRoutes(routes)}</Suspense>
    </HashRouter>,
  document.getElementById('root') as HTMLElement
);